import { createBrowserRouter, createHashRouter } from "react-router-dom";
import { AuthRouter } from "@/components/AuthRouter";
import Task from "../pages/Task";
import Login from "../pages/Login";
import Home from "../pages/Home";
import User from "../pages/User";
import Layout from "../layout";

const router = createBrowserRouter([
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "/",
    element: (
      <AuthRouter>
        <Layout />
      </AuthRouter>
    ),
    children: [
      {
        index: true,
        element: <Home />,
      },
      {
        path: "/user",
        element: <User />,
      },
      {
        path: "/task",
        element: <Task />,
      },
    ],
  },
]);

export default router;
